import os

WORK_DIR = os.path.dirname(os.path.abspath(__file__))


DATASET_DIR = os.getenv('DATASET_DIR', os.path.join(WORK_DIR, 'dataset'))
DATABASE_DIR = os.getenv('DATABASE_DIR', os.path.join(WORK_DIR, 'database'))
VECTORSTORE_DIR = os.getenv('VECTORSTORE_DIR', os.path.join(WORK_DIR, 'vectorstore'))

for dir in [DATASET_DIR, DATABASE_DIR, VECTORSTORE_DIR]:
    if not os.path.exists(dir) or not os.path.isdir(dir):
        os.makedirs(dir, exist_ok=True)


DATASET2DATABASE = {
    "大伙房水库": "DHF_reservoir",
}

DATABASES = ["DHF_reservoir"]

DATABASE2DATASET = {v: k for k, v in DATASET2DATABASE.items()}

if __name__ == '__main__':
    print("DATASET_DIR:", DATASET_DIR)
    print("DATABASE_DIR:", DATABASE_DIR)
    print("VECTORSTORE_DIR:", VECTORSTORE_DIR)
    print("DATASET2DATABASE:", DATASET2DATABASE)